<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:c="http://java.sun.com/jsp/jstl/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:g="http://giava.by/common/base"
	template="/WEB-INF/layout/t.xhtml">

	<ui:define name="title">
		<h:outputText value="Scheda Company" />
	</ui:define>
	<ui:define name="roles">
		<f:attribute name="roles" value="company" />
	</ui:define>
	<ui:define name="content">
		<h:form>
			<center>
				<p:panel header="Scheda Company">

					<h:panelGrid columns="2">

						<h:outputLabel for="name" value="Nome (*):" style="width: 100%;" />
						<h:outputText id="name" value="#{companyController.element.name}"
							style="width: 100%;" />

						<h:outputLabel for="spot" value="Spot:" style="width: 100%;" />
						<h:outputText id="spot" value="#{companyController.element.spot}"
							style="width: 100%;" />

						<h:outputLabel for="address" value="Indirizzo (*):"
							style="width: 100%;" />
						<h:outputText id="address"
							value="#{companyController.element.address}" style="width: 100%;" />

						<h:outputLabel for="city" value="Citta' (*):" style="width: 100%;" />
						<h:outputText id="city" value="#{companyController.element.city}"
							style="width: 100%;" />

						<h:outputLabel for="province" value="Provincia (*):"
							style="width: 100%;" />
						<h:outputText id="province"
							value="#{companyController.element.province}"
							style="width: 100%;" />

						<h:outputLabel for="cap" value="Cap (*):" style="width: 100%;" />
						<h:outputText id="cap" value="#{companyController.element.cap}"
							style="width: 100%;" />

						<h:outputLabel for="telephone" value="Telefono:"
							style="width: 100%;" />
						<h:outputText id="telephone"
							value="#{companyController.element.telephone}"
							style="width: 100%;" />

						<h:outputLabel for="fax" value="fax:" style="width: 100%;" />
						<h:outputText id="fax" value="#{companyController.element.fax}"
							style="width: 100%;" />


						<h:outputLabel for="email" value="Email:" style="width: 100%;" />
						<h:outputText id="email"
							value="#{companyController.element.email}" style="width: 100%;" />
							
						<h:outputLabel for="emailNewsletter" value="Email Newsletter:" style="width: 100%;" />
						<h:outputText id="emailNewsletter"
							value="#{companyController.element.emailNewsletter}" style="width: 100%;" />
							

						<h:outputLabel for="vat" value="P.IVA (*):" style="width: 100%;" />
						<h:outputText id="vat" value="#{companyController.element.vat}"
							style="width: 100%;" />

						<h:outputLabel for="lat" value="latitudine:" style="width: 100%;" />
						<h:outputText id="lat" value="#{companyController.element.lat}"
							style="width: 100%;" />

						<h:outputLabel for="lon" value="longitudine:" style="width: 100%;" />
						<h:outputText id="lon" value="#{companyController.element.lon}"
							style="width: 100%;" />

						<h:outputLabel for="preview" value="Anteprima breve:" />
						<h:outputText id="preview" cols="20" rows="20"
							value="#{companyController.element.preview}"
							style="height: 166px; width: 100%;" escape="false" />

						<h:outputLabel for="description" value="Descrizione:" />
						<h:outputText id="description" cols="20" rows="20"
							value="#{companyController.element.description}"
							style="height: 166px; width: 100%;" escape="false" />


						<h:outputLabel for="secondaryAddress"
							value="Indirizzo Secondario:" />
						<h:outputText
							value="#{companyController.element.secondaryAddress}"
							id="secondaryAddress" style=" height : 166px; width: 100%;" />

						<h:outputLabel for="telephoneNumbers" value="Numeri di Telefono:" />
						<h:outputText
							value="#{companyController.element.telephoneNumbers}"
							id="telephoneNumbers" style=" height : 166px; width: 100%;" />

						<h:outputLabel value="Immagine:" for="image" />
						<h:panelGroup layout="block" id="image">
							<h:graphicImage
								value="/img/#{companyController.element.image.filename}"
								alt="#{companyController.element.image.filename}"
								title="#{companyController.element.image.filename}"
								style="padding: 5px;"
								rendered="#{not empty companyController.element.image}" />
							<h:outputText value="nessuno"
								rendered="#{empty companyController.element.image}" />
						</h:panelGroup>

						<h:outputLabel value="Logo:" for="logo" />
						<h:panelGroup layout="block" id="logo">
							<h:graphicImage
								value="/img/#{companyController.element.logo.filename}"
								alt="#{companyController.element.logo.filename}"
								title="#{companyController.element.logo.filename}"
								style="padding: 5px;"
								rendered="#{not empty companyController.element.logo}" />
							<h:outputText value="nessuno"
								rendered="#{empty companyController.element.logo}" />
						</h:panelGroup>
						
						<h:outputLabel value="principale?:" for="principal" />
						<h:outputText value="si"
							rendered="#{false or companyController.element.principal}"
							id="principal" />
						<h:outputText value="no"
							rendered="#{false or not companyController.element.principal}"
							id="principal2" />
						<h:outputLabel for="video" value="video:" style="width: 100%;" />
						<h:outputText id="video"
							value="#{companyController.element.video}" style="width: 100%;" />
					</h:panelGrid>
					<p:media value="#{companyController.element.video}" width="425"
						height="344" player="flash"
						rendered="#{not empty companyController.element.video}" />

				</p:panel>
				<br /> <br />
				<h:panelGrid columns="2">
					<h:commandButton action="#{companyController.modCurrent}"
						value="Modifica Testi" />
					<h:commandButton action="#{companyController.modImage}"
						value="Modifica Immagine" />
				</h:panelGrid>
			</center>
		</h:form>

	</ui:define>
</ui:composition>